package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "chunked_mac_impl",
    srcs = ["chunked_mac_impl.cc"],
    hdrs = ["chunked_mac_impl.h"],
    include_prefix = "tink/mac/internal",
    deps = [
        "//:chunked_mac",
        "//proto:aes_cmac_cc_proto",
        "//proto:hmac_cc_proto",
        "//subtle:stateful_cmac_boringssl",
        "//subtle:stateful_hmac_boringssl",
        "//subtle/mac:stateful_mac",
        "//util:enums",
        "//util:secret_data",
        "//util:status",
        "//util:statusor",
        "@boringssl//:crypto",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "chunked_mac_wrapper",
    srcs = ["chunked_mac_wrapper.cc"],
    hdrs = ["chunked_mac_wrapper.h"],
    include_prefix = "tink/mac/internal",
    deps = [
        "//:chunked_mac",
        "//:crypto_format",
        "//:primitive_set",
        "//:primitive_wrapper",
        "//internal:util",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "config_v0",
    srcs = ["config_v0.cc"],
    hdrs = ["config_v0.h"],
    include_prefix = "tink/mac/internal",
    deps = [
        ":chunked_mac_wrapper",
        "//:configuration",
        "//internal:configuration_impl",
        "//mac:aes_cmac_key_manager",
        "//mac:hmac_key_manager",
        "//mac:mac_wrapper",
        "//util:status",
        "@com_google_absl//absl/memory",
    ],
)

cc_library(
    name = "key_gen_config_v0",
    srcs = ["key_gen_config_v0.cc"],
    hdrs = ["key_gen_config_v0.h"],
    include_prefix = "tink/mac/internal",
    deps = [
        "//:key_gen_configuration",
        "//internal:key_gen_configuration_impl",
        "//mac:aes_cmac_key_manager",
        "//mac:hmac_key_manager",
        "//util:status",
        "@com_google_absl//absl/memory",
    ],
)

# tests

cc_test(
    name = "chunked_mac_impl_test",
    size = "small",
    srcs = ["chunked_mac_impl_test.cc"],
    deps = [
        ":chunked_mac_impl",
        "//:chunked_mac",
        "//proto:aes_cmac_cc_proto",
        "//proto:common_cc_proto",
        "//proto:hmac_cc_proto",
        "//subtle/mac:stateful_mac",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "chunked_mac_wrapper_test",
    size = "small",
    srcs = ["chunked_mac_wrapper_test.cc"],
    deps = [
        ":chunked_mac_impl",
        ":chunked_mac_wrapper",
        "//:chunked_mac",
        "//proto:tink_cc_proto",
        "//subtle/mac:stateful_mac",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_absl//absl/strings",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "chunked_mac_test",
    size = "small",
    srcs = ["chunked_mac_test.cc"],
    deps = [
        "//:chunked_mac",
        "//:keyset_handle",
        "//:mac",
        "//mac:mac_config",
        "//mac:mac_key_templates",
        "//proto:tink_cc_proto",
        "//util:status",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "config_v0_test",
    srcs = ["config_v0_test.cc"],
    deps = [
        ":config_v0",
        ":key_gen_config_v0",
        "//:chunked_mac",
        "//:configuration",
        "//:key_gen_configuration",
        "//:keyset_handle",
        "//:mac",
        "//internal:configuration_impl",
        "//internal:key_gen_configuration_impl",
        "//internal:key_type_info_store",
        "//internal:keyset_wrapper_store",
        "//mac:aes_cmac_key_manager",
        "//mac:hmac_key_manager",
        "//mac:mac_key_templates",
        "//util:statusor",
        "//util:test_matchers",
        "@com_google_googletest//:gtest_main",
    ],
)
